Skip to content

Instantly share code, notes, and snippets.

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Create Free AWS Account

Create free AWS Account at https://aws.amazon.com/

2. Create and Lauch an EC2 instance and SSH into machine

I would be creating a t2.medium ubuntu machine for this demo.

@latenitecoding
latenitecoding / starship.toml
Last active May 18, 2024 06:01
My starship configuration
format = """
[░▒▓](#a3aed2)\
[  ](bg:#a3aed2 fg:#090c0c)\
[](bg:#769ff0 fg:#a3aed2)\
$directory\
[](fg:#769ff0 bg:#394260)\
$git_branch\
$git_status\
[](fg:#394260 bg:#212736)\
$nodejs\
@ssskip
ssskip / ISO3166-1.alpha2.json
Last active May 18, 2024 06:00
json of country codes (ISO 3166-1 alpha-2) and corresponding names
{
"AF": "Afghanistan",
"AX": "Aland Islands",
"AL": "Albania",
"DZ": "Algeria",
"AS": "American Samoa",
"AD": "Andorra",
"AO": "Angola",
"AI": "Anguilla",
"AQ": "Antarctica",
@OlfillasOdikno
OlfillasOdikno / Linux_GPU_PV.md
Last active May 18, 2024 05:59
Hyperv Linux Guest GPU PV

Hyperv Linux Guest GPU PV

  • Create VM
$isopath = <iso location>
$vhdpath = <vhdx location>
$vmpath = <vm path>
$vmname = "Arch-dxgkrnl"
New-VM -Name $vmname -MemoryStartupBytes 8GB -BootDevice VHD -NewVHDPath $vhdpath -Path $vmpath -NewVHDSizeBytes 20GB -Generation 2 -Switch "Default Switch"
@mietzen
mietzen / macos-bitwarden-cli-with-touch-id.md
Last active May 18, 2024 05:58
How to use use Bitwarden CLI with macOS Touch ID

How to use Bitwarden CLI with macOS Touch ID

If you want to use Bitwarden CLI for ssh have a look at: How to use use Bitwarden CLI for SSH-Keys in macOS

Wirtten and tested on macOS Ventura

Configure Touch ID for the sudo command

To allow Touch ID on your Mac to authenticate you for sudo access instead of a password you need to do the following.

@mietzen
mietzen / macos-bitwarden-cli-ssh.md
Last active May 18, 2024 05:57
How to use use Bitwarden CLI for SSH-Keys in macOS

How to use use Bitwarden CLI for SSH-Keys in macOS

If you want to use Touch ID have a look at: How to use use Bitwarden CLI with macOS Touch ID

Wirtten and tested on macOS Ventura

Add SSH-Keys to Bitwarden

Before you can use Bitwarden CLI for your SSH private keys you have to add them to your Bitwarden account. Just create a normal login. The name, username and URI fields doesn't matter for my functions.

@Unity-Javier
Unity-Javier / DumpAllAssetPaths.cs
Created February 17, 2020 10:26
Get the path to the Library folder (or in-memory DB) for all assets in a project
using System.IO;
using System.Text;
using UnityEditor;
using UnityEditor.Experimental;
using UnityEngine;
public class DumpAllAssetPaths : MonoBehaviour
{
[MenuItem("AssetDatabase/OutputAllLibraryPaths")]
public static void OutputPathToAssets()
@longthinh
longthinh / Shu File.md
Last active May 18, 2024 05:55
Magic File Viewer - Shu | Version History

1.2.4 Apr 15, 2022 Removed

  • preview / extract contents from winmail.dat of mails
  • add password support with zipping file
  • add JPEG XL preview and conversion
  • preview / convert 3D model files
  • multi-frame support for heic/heif image
  • scan documents from camera on iOS 13+: Shu home > top-right Edit > Camera Scan
  • extract textual PDF as .txt file: right-top menu > View Contents
@JakubPetriska
JakubPetriska / quotes.csv
Last active May 18, 2024 05:52
Motivational quotes
Author Quote
Thomas Edison Genius is one percent inspiration and ninety-nine percent perspiration.
Yogi Berra You can observe a lot just by watching.
Abraham Lincoln A house divided against itself cannot stand.
Johann Wolfgang von Goethe Difficulties increase the nearer we get to the goal.
Byron Pulsifer Fate is in your hands and no one elses
Lao Tzu Be the chief but never the lord.
Carl Sandburg Nothing happens unless first we dream.
Aristotle Well begun is half done.
Yogi Berra Life is a learning experience, only if you learn.
@ctlllll
ctlllll / longest_chinese_tokens_gpt4o.py
Created May 13, 2024 19:53
Longest Chinese tokens in gpt4o
import tiktoken
import langdetect
T = tiktoken.get_encoding("o200k_base")
length_dict = {}
for i in range(T.n_vocab):
try:
length_dict[i] = len(T.decode([i]))
except: